class PreSaleModel {
  bool? hasNext;
  List<PreSaleVideoModel>? list;
  PreSaleDetailModel? detailModel;
  PreSaleModel({this.hasNext, this.list, this.detailModel});

  PreSaleModel.fromJson(Map<String, dynamic> map) {
    hasNext = map['hasNext'] ?? false;
    list = (map['list'] as List?)?.map((o) => PreSaleVideoModel.fromJson(o)).toList();
    detailModel = PreSaleDetailModel.fromJson(map['activityDetail']);
  }

  Map toJson() => {
        "hasNext": hasNext,
        "list": list,
        "PreSaleDetailModel": PreSaleDetailModel,
      };
}

class PreSaleVideoModel {
  PreSaleVideoModel({
    this.id,
    this.vidId,
    this.vidTitle,
    this.cover,
    this.sourceURL,
    this.seriesCover,
    this.coins,
    this.detail,
  });

  PreSaleVideoModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    vidId = json['vidId'];
    vidTitle = json['vidTitle'];
    sourceURL = json['sourceURL'];
    cover = json['cover'];
    seriesCover = json['seriesCover'] != null ? json['seriesCover'].cast<String>() : [];
    coins = json['coins'];
    detail = json['detail'];
  }
  String? id;
  String? vidId;
  String? vidTitle;
  String? sourceURL;
  String? cover;
  List<String>? seriesCover;
  num? coins;
  dynamic detail;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['vidId'] = vidId;
    map['vidTitle'] = vidTitle;
    map['sourceURL'] = sourceURL;
    map['cover'] = cover;
    map['seriesCover'] = seriesCover;
    map['coins'] = coins;
    map['detail'] = detail;
    return map;
  }
}

class PreSaleDetailModel {
  String? activityTime; //活动时间
  bool? balancePayment; //是否有尾款支付
  String? endTime; // 支付尾款结束时间
  String? startTime; // 支付尾款开始时间
  num? totalCount; //会员卡总数
  num? status; //预售订单状态
  num? balanceAmount; //尾款金额
  num? advanceAmount; //预付金额

  PreSaleDetailModel({
    this.activityTime,
    this.balancePayment,
    this.endTime,
    this.startTime,
    this.totalCount,
    this.status,
    this.balanceAmount,
    this.advanceAmount,
  });

  PreSaleDetailModel.fromJson(dynamic json) {
    activityTime = json['activityTime'];
    balancePayment = json['balancePayment'];
    endTime = json['endTime'];
    startTime = json['startTime'];
    totalCount = json['totalCount'];
    status = json['status'];
    balanceAmount = json['balanceAmount'];
    advanceAmount = json['advanceAmount'];
  }

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['activityTime'] = activityTime;
    map['balancePayment'] = balancePayment;
    map['endTime'] = endTime;
    map['startTime'] = startTime;
    map['totalCount'] = totalCount;
    map['status'] = status;
    map['balanceAmount'] = balanceAmount;
    map['advanceAmount'] = advanceAmount;
    return map;
  }
}

//预售页面资源
class AdvancePage {
  String? banner; //个人中心 立即预定
  String? bannerWait; //个人中心 已预定，去支付尾款
  String? bannerProc; //个人中心 已预定，去支付尾款

  String? buttonBackground; //支付按钮 立即预定
  String? buttonProcBackground; //支付按钮 已预定，去支付尾款
  String? buttonWaitBackground; //支付按钮 已预定，未到支付时间

  String? enterBgProc; //入口按钮背景（付尾款）
  String? enterBgWait; //入口按钮背景（未付款）
  String? pageBackground; //大背景
  String? popBgProc; //弹窗背景（付尾款）
  String? popBgWait; //弹窗背景（未付款）
  String? pageVidBackground; //金币视频区的背景图

  AdvancePage.fromJson(dynamic json) {
    banner = json['banner'];
    bannerWait = json['bannerWait'];
    bannerProc = json['bannerProc'];

    buttonBackground = json['buttonBackground'];
    buttonProcBackground = json['buttonProcBackground'];
    buttonWaitBackground = json['buttonWaitBackground'];

    enterBgProc = json['enterBgProc'];
    enterBgWait = json['enterBgWait'];
    pageBackground = json['pageBackground'];
    popBgProc = json['popBgProc'];
    popBgWait = json['popBgWait'];
    pageVidBackground = json['pageVidBackground'];
  }

}
